RETURN Statement ---------------------------------------------------------------------------- Action Returns control from a routine. Syntax RETURN { linelabel | linenumber} Remarks Without a line label or number, RETURN continues execution where an event occurred (for event handling) or at the statement following the GOSUB statement (for subroutine calls). GOSUB and RETURN without a line number can be used anywhere in a program, but the GOSUB and corresponding RETURN must be at the same level. The linelabel or linenumber in the RETURN statement causes an unconditional return from a GOSUB subroutine to the specified line. RETURN with a line label or line number can return control to a statement in the module-level code only, not in procedure-level code. A RETURN statement cannot be used to return control to a calling program from a SUB procedure. Use EXIT SUB for this purpose. Note BASIC's SUB procedures provide a better-structured alternative to GOSUB subroutines. See Also EXIT, GOSUB, ON event Example See the GOSUB statement programming example, which uses the RETURN statement.